<template>
    <!-- 连锁超市 -->
    <div class="header-super-store d-none d-xl-block d-lg-none d-md-block">
                            <div class="dropdown">
                                <button @click.prevent="axiosGetsuperstoreList" class="dropdown-toggle" type="button" id="dropdownMenuButton4" data-toggle="dropdown" aria-haspopup="true"
                                    aria-expanded="false"><i class="flaticon-shop"></i>连锁超市</button>
                                <div class="dropdown-menu" aria-labelledby="dropdownMenuButton4">
                                    <router-link class="dropdown-item" v-for="store in superstoreList" :key="store.id"  :to="`${routerprefix}/${store.id}/${store.name}`">{{store.name }}</router-link>
                                    <router-link class="dropdown-item" :to="`${routerall}`" v-if="superstoreList.length>0" style="color: green;">全部</router-link>
                                  
                                </div>
                            </div>
                        </div>
</template>

<script>


import {getsuperstoreList} from '@/api/head'
export default {
    data() {
        return {
            routerprefix:'/store',
            routerall:'/store/all',
            superstoreList:[]
        }
    },
    methods: {
        axiosGetsuperstoreList(){
            getsuperstoreList().then(superstoreList=>{
                this.superstoreList=superstoreList;
            })
    },
    },
    
}
</script>

<style>

</style>